package com.ay.smartpark.sdk.common.utils;


import com.ay.smartpark.sdk.common.base.OnlineUserInfo;

public class OnlineUserInfoUtil {

    private static final ThreadLocal<OnlineUserInfo> onlineUserThreadLocal = new ThreadLocal<>();

    public static void setUserInfo(OnlineUserInfo onlineUserInfo) {
        if (null == onlineUserThreadLocal.get()) {
            onlineUserThreadLocal.set(onlineUserInfo);
        }
    }

    public static OnlineUserInfo getOnlineUserInfo() {
        return onlineUserThreadLocal.get();
    }

    public static void clearOnlineUserInfo() {
        onlineUserThreadLocal.remove();
    }


}
